﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Ingresos.aspx.cs" Inherits="Ingresos" %>

<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
    .style1
    {
        font-size: medium;
    }
        .style2
        {
            color: #FFFF00;
            font-size: large;
        }
        .style3
        {
            color: #FF0000;
            font-size: small;
        }
        .style4
        {
            color: #0033CC;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
<span class="style1">Bienvenida: Tesorera<br />
EL ESTADO DE ESTE PRESUPUESTO ES: ABIERTO A EDICION</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
INGRESOS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Panel ID="Panel1" runat="server" GroupingText="Agregar Ingreso" Width="900px">
    <asp:RadioButton ID="RadioButton1" runat="server" Checked="True" 
        Text="Existente" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="DropDownList2" runat="server" Width="224px">
    </asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cantidad:
    <asp:TextBox ID="TextBox2" runat="server" Width="34px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp; Valor Unitario($us):
    <asp:TextBox ID="TextBox3" runat="server" Width="67px"></asp:TextBox>
    <br />
    <asp:RadioButton ID="RadioButton2" runat="server" Text="Nuevo" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox1" runat="server" Width="225px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button4" runat="server" Text="Añadir" />
</asp:Panel>
&nbsp;<asp:GridView ID="GridView2" runat="server" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="SqlDataSource6" DataKeyNames="Numero" Width="462px" 
        AllowPaging="True">
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:BoundField DataField="Numero" HeaderText="Numero" 
            SortExpression="Numero" ReadOnly="True" />
        <asp:BoundField DataField="Ingreso" HeaderText="Ingreso" 
            SortExpression="Ingreso" />
        <asp:BoundField DataField="ValorUnitario" HeaderText="ValorUnitario" 
            SortExpression="ValorUnitario" />
        <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" 
            SortExpression="Cantidad" />
        <asp:BoundField DataField="Total" HeaderText="Total" SortExpression="Total" 
            ReadOnly="True" />
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Prueba1ConnectionString %>" 
    DeleteCommand="DELETE FROM [Presupuesto] WHERE [Numero] = @Numero" 
    InsertCommand="INSERT INTO [Presupuesto] ([Numero], [Ingreso], [ValorUnitario], [Cantidad], [Total]) VALUES (@Numero, @Ingreso, @ValorUnitario, @Cantidad, @Total)" 
    SelectCommand="SELECT * FROM [Presupuesto]" 
    UpdateCommand="UPDATE [Presupuesto] SET [Ingreso] = @Ingreso, [ValorUnitario] = @ValorUnitario, [Cantidad] = @Cantidad, [Total] = @Total WHERE [Numero] = @Numero">
        <DeleteParameters>
            <asp:Parameter Name="Numero" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Numero" Type="Int32" />
            <asp:Parameter Name="Ingreso" Type="String" />
            <asp:Parameter Name="ValorUnitario" Type="Double" />
            <asp:Parameter Name="Cantidad" Type="Int32" />
            <asp:Parameter Name="Total" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Ingreso" Type="String" />
            <asp:Parameter Name="ValorUnitario" Type="Double" />
            <asp:Parameter Name="Cantidad" Type="Int32" />
            <asp:Parameter Name="Total" Type="Double" />
            <asp:Parameter Name="Numero" Type="Int32" />
        </UpdateParameters>
</asp:SqlDataSource>
    <br />
    <span class="style4"><strong>Total Ingresos: XYZ</strong></span><asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Prueba1ConnectionString %>" 
    DeleteCommand="DELETE FROM [Presupuesto] WHERE [Numero] = @Numero" 
    InsertCommand="INSERT INTO [Presupuesto] ([Numero], [Ingreso], [ValorUnitario], [Cantidad], [Total]) VALUES (@Numero, @Ingreso, @ValorUnitario, @Cantidad, @Total)" 
    SelectCommand="SELECT * FROM [Presupuesto]" 
    UpdateCommand="UPDATE [Presupuesto] SET [Ingreso] = @Ingreso, [ValorUnitario] = @ValorUnitario, [Cantidad] = @Cantidad, [Total] = @Total WHERE [Numero] = @Numero">
    <DeleteParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="Numero" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
EGRESOS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Panel ID="Panel2" runat="server" GroupingText="Agregar Egreso" Width="900px">
     <asp:RadioButton ID="RadioButton3" runat="server" Checked="True" 
        Text="Existente" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList ID="DropDownList3" runat="server" Width="224px">
    </asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cantidad:
    <asp:TextBox ID="TextBox4" runat="server" Width="38px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp; Valor Unitario($us):
    <asp:TextBox ID="TextBox5" runat="server" Width="49px"></asp:TextBox>
    <br />
    <asp:RadioButton ID="RadioButton4" runat="server" Text="Nuevo" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="TextBox6" runat="server" Width="225px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button5" runat="server" Text="Añadir" />
</asp:Panel>
&nbsp;<asp:GridView ID="GridView3" runat="server" 
    AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
    BorderStyle="None" BorderWidth="1px" CellPadding="3" 
    DataSourceID="SqlDataSource6" DataKeyNames="Numero" Width="458px" 
        AllowPaging="True">
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:BoundField DataField="Numero" HeaderText="Numero" ReadOnly="True" 
            SortExpression="Numero" />
        <asp:BoundField DataField="Ingreso" HeaderText="Ingreso" 
            SortExpression="Ingreso" />
        <asp:BoundField DataField="ValorUnitario" HeaderText="ValorUnitario" 
            SortExpression="ValorUnitario" />
        <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" 
            SortExpression="Cantidad" />
        <asp:BoundField DataField="Total" HeaderText="Total" ReadOnly="True" 
            SortExpression="Total" />
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
    <SortedAscendingCellStyle BackColor="#F1F1F1" />
    <SortedAscendingHeaderStyle BackColor="#007DBB" />
    <SortedDescendingCellStyle BackColor="#CAC9C9" />
    <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
    <br />
    <span class="style3"><strong>Total Egresos: XYZ</strong></span><asp:SqlDataSource ID="SqlDataSource4" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Prueba1ConnectionString %>" 
    DeleteCommand="DELETE FROM [Presupuesto] WHERE [Numero] = @Numero" 
    InsertCommand="INSERT INTO [Presupuesto] ([Numero], [Ingreso], [ValorUnitario], [Cantidad], [Total]) VALUES (@Numero, @Ingreso, @ValorUnitario, @Cantidad, @Total)" 
    SelectCommand="SELECT * FROM [Presupuesto]" 
    UpdateCommand="UPDATE [Presupuesto] SET [Ingreso] = @Ingreso, [ValorUnitario] = @ValorUnitario, [Cantidad] = @Cantidad, [Total] = @Total WHERE [Numero] = @Numero">
    <DeleteParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Numero" Type="Int32" />
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Ingreso" Type="String" />
        <asp:Parameter Name="ValorUnitario" Type="Double" />
        <asp:Parameter Name="Cantidad" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="Numero" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
<br />
    <span class="style2"><strong>INGRESOS-EGRESOS ESTIMADOS: XYZ</strong></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button6" runat="server" style="text-align: center" 
    Text="Cerrar Presupuesto" onclick="Button6_Click" />
<br />
<br />
<br />
&nbsp;<br />
<p>
    <br />
<br />
<br />
<br />
<br />
</p>
</asp:Content>

